<?php
/**
 *
 * 公用页面显示方法
 *
 * @author		Tata <windzb@qq.com>
 */


// ------------------------------------------------------------------------
/*
 * 显示出错页面
 */
function show_err_page($err_msg = '出错了')
{
	//header("Content-type: text/html; charset=gb2312");
	include_once(VIEWS_PATH.'/common/error.php');
	return false;
}

// ------------------------------------------------------------------------

/*
 * 显示前端页面
 */
function show_front_page($page)
{
	//header("Content-type: text/html; charset=gb2312");
	include_once(VIEWS_FRONT_PATH.'/'.$page.'.html');
}

// ------------------------------------------------------------------------

/*
 * 显示前端页面
 */
function show_admin_page($page)
{
    //header("Content-type: text/html; charset=gb2312");
    include_once(VIEWS_ADMIN_PATH.'/'.$page.'.php');
}

// ------------------------------------------------------------------------
/*
 * 返回出错AJAX
 */
function show_err_ajax($msg = '出错了',$submsg = '')
{
	$callback = $_GET["callback"];
	$json_array = array(
		'msg'=>$msg,
		'submsg'=>$submsg
	);
	$str = $callback.'('.json_encode($json_array).')';

	$appLog->info("ajax-err".$str);
	header('KissyIoDataType:jsonp');
	//header('Content-Type:text/html; charset=GBK');
	echo ($str);
}